<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Widget</title>

    <!-- ================= Favicon ================== -->

    <!-- Styles -->
    <link href="__VIS__/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="__VIS__/css/lib/themify-icons.css" rel="stylesheet">
    <link href="__VIS__/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="__VIS__/css/lib/unix.css" rel="stylesheet">
    <link href="__VIS__/css/style.css" rel="stylesheet">

    <style>
        .setmybg{
            color: #333333;
            background: rgba(255,255,255,0.3) !important;
        }
    </style>
</head>

<body class="bg-primary">

<div class="unix-login">
    <div class="container">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                <div class="login-content">
                    <div class="login-form">
                        <h4>Visphp Login</h4>
                        <form class="vis-form">
                            <div class="form-group">
                                <label>Username</label>
                                <input type="text" name="username" class="form-control" placeholder="Username">
                            </div>
                            <div class="form-group">
                                <label>Password</label>
                                <input type="password" name="password" class="form-control" placeholder="Password">
                            </div>
                            <div class="form-group">
                                <label>Captcha</label>
                                <div style="position: relative">
                                <input type="captcha" name="captcha" class="form-control" placeholder="Captcha">
                                <img src="{:url('basic/captcha')}" onclick="this.src='{:url('basic/captcha')}?seed='+Math.random()" height="36" id="captcha" style="margin-top: 1px;position: absolute;right: 2px;top:2px"/>
                                </div>
                            </div>
                            <div class="checkbox">
                                <label>

                                </label>
                                <label class="pull-right">
                                    <a href="#">Forgotten Password?</a>
                                </label>

                            </div>
                            <a  class="btn btn-primary btn-flat m-b-30 m-t-30 vis_login">Sign in</a>

                            <div class="register-link m-t-15 text-center">
                                <p>Don't have account ? <a href="#"> Sign Up Here</a></p>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__VIS__/js/jquery.min.js"></script>
<script src="__VIS__/js/layer/layer.js"></script>
<script>
    $(function () {
        $('.vis_login').click(function () {
            $.ajax({
                uri:"{:url('index')}",
                type:'POST',
                dataType:'JSON',
                data:$('.vis-form').serialize(),
                success:function (res) {
                    if(res.code == 1){
                        layer.msg(res.msg,{icon:6,skin: 'setmybg'},function () {
                            window.location.href=res.url;
                        })
                    }else {
                        layer.msg(res.msg,{icon:5,skin: 'setmybg'},function () {
                            $('#captcha').click();
                        })
                    }
                }
            })
        })
    })
</script>
</body>

</html>